﻿@model IEnumerable<GSLMS.Entity.TB_APP_PROCOMINFO>
@{
    Layout = null;
    int i = 0;

    var isSolu = (bool)ViewData["isSolu"];
}
<div class="pageContent">
   
    <table class="list" width="100%" id="proSoluConfirmTale">
        <thead>
            <tr class="header">
                <th>
                    选择
                </th>
                <th>
                    序号
                </th>
                <th>
                    批核金额(万元)
                </th>
                <th>
                    贷款利率(%)
                </th>
                <th>
                    管理费率(%)
                </th>
                <th>
                    综合费率(%)
                </th>
                <th>
                    期限
                </th>
                <th>
                    还款方式
                </th>
                <th>
                    预收费用(元)
                </th>
                <th>
                    备注
                </th>
            </tr>
        </thead>
        @if (Model != null)
        {
            foreach (var item in Model)
            {            
            <tr>
                <td style="text-align:center;">
                   @if(isSolu)
                   {
                     <input type="radio" name="selSolu" disabled="disabled" value="@item.PROGID"  @((item.CONFIRMBY!=null&&item.CONFIRMBY.Trim() != "") ? "checked='checked'" : "") />
                   }
                   else
                   {
                   @Html.RadioButton("selSolu",item.PROGID)
                    }
                </td>
                <td style="text-align:center;">
                    @item.PROGNO
                </td>
                <td style="text-align:right;">
                    @item.AMT
                </td>
                <td style="text-align:right;">
                    @item.RATE
                </td>
                <td style="text-align:right;">
                    @item.MANAGERATE
                </td>
                <td style="text-align:right;">
                    @item.GENERALRATE
                </td>
                <td style="text-align:center;">
                    @item.LOANTIME
                    @(item.LOANPHASE == 0 ? "天" : "月")
                </td>
                <td style="text-align:center;">
                    @((GSLMS.Entity.Enum.ApplyEnum.ProRepayment)item.LOANPHASETYPE)
                </td>
                <td style="text-align:right;">
                    @item.ADVAMT
                </td>
                <td>
                    @item.AUDITREMARK
                </td>
            </tr> 
            
                i += 1;
            }
        }
    </table>
    @if (!isSolu)
    {
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" onclick="SumbitSoluConfirm()">
                            确认</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent" onclick="SumbitSoluBack()">
                        <button type="button">
                            退回</button></div>
                </div>
            </li>
        </ul>
    </div>
    }
</div>
<script>
    function SumbitSoluConfirm() {
        var selID = $('input:radio:checked').val();
        
        if (selID) {
            $.ajax({
                type: 'POST',
                url: "DianDang/Apply/ProInfo/SoluConfirm",
                data: { proid: '@ViewData["ProID"]',Hid_PROGID:selID },
                cache: false,
                success: function (json) {
                    var resut = eval("(" + json + ")");
                    dialogAjaxDone(resut);
                },
                error: DWZ.ajaxError
            });
        }
        else {
            alertMsg.error("请选择方案。");
        }
    }
    function SumbitSoluBack() {
        $.pdialog.closeCurrent();
        $.pdialog.open('DianDang/Apply/ProInfo/SoluBack/@ViewData["ProID"]', "SoluBack", "输入退回原因", {width:500,height:350,mask:true});
    }
</script>
